package com.example.demo.juc.lock;

/**
 * @Description:
 * @Author: xiatian
 * @CreateTime: 2021/8/24
 * @Company: kangxu
 */
    public class WaitTest2 extends Thread {

        private Object look;

        public WaitTest2(Object look) {
            this.look = look;
        }

        @Override
        public void run() {
            try {
                synchronized (look) {
                    System.out.println("notify start...");
                    look.notify();
                    System.out.println("notify end...");
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
}
